package com.fintech.third.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.dragon.common.repository.mybatis.MyBatisRepository;
import com.fintech.common.constant.Criteria;
import com.fintech.user.entity.RealNameAuthentication;
import com.fintech.user.entity.User;
@MyBatisRepository
public interface UserDao {

	public User login(User user);

	/**
	 * @param user
	 * @return
	 */
	public int insertUser(User user);
	
	/**
	 * @param mobileNo
	 * @return
	 */
	public User queryUserByMobileNo(@Param("mobileNo") String mobileNo,@Param("userType")String userType);
	
	
	/**
	 * @param mobileNo
	 * @return
	 */
	public User queryByMobileNo(@Param("mobileNo") String mobileNo);
	
	/**
	 * @return
	 */
	public User queryUserById(Integer id);
	
	/**
	 * 閺嶈宓佹惔蹇撳灙閸欓攱鐓＄拠锟�
	 * @param idFintechUmUser
	 * @return
	 */
	public User queryIdFintechUmUser(String idFintechUmUser);
	
	/**
	 * @param user
	 * @return
	 */
	public int modifyUserInfoById(User user);
	
	/**
	 * @param user
	 * @return
	 */
	public int modifyUserStatusById(User user);
	
	
	public User query_by_phone(String username);
	public int updatePwd(User user);
	
	/**
	 * @param id
	 * @return
	 */
	List<User> queryByOrgId(Integer orgId);
	
	/**
	 * @return
	 */
	List<User> queryByLevelAndLevelId(@Param("level") Integer level,@Param("levelId") Integer levelId);
	
	/**
	 * @param organizeId
	 * @return
	 */
	List<User> queryByOrganizeId(Integer organizeId);
	/**
	 * @param userId
	 * @return
	 */
	Map<String,Object> orgIdByUserId(String userId);
	
	List<User> queryPage(Criteria<User> param);
	
	Integer queryCount(Criteria<User> param);
	
	User queryByOpenId(String openId);
	/**
	 * 鏌ヨ鎵�鏈夌殑瀹㈡埛缁忕悊
	 * @param param
	 * @return
	 */
	public List<User> findCustManager(Map<String, Object> param);

	public Integer findCustManagerCount(Map<String, Object> param);

	public void deleteUserByUserId(Integer userId);
	
	public void cancelUserByUserId(@Param("userId") Integer userId, @Param("reason") String reason);
	
	User queryByIdCard(String idCard);
	User queryByIdCardAndName(@Param("idCard")String idCard,@Param("name")String name);
	
	//娓犻亾绠＄悊淇敼璐熻矗浜虹殑鐘舵��
	public void updateByOrgId(Criteria<User> param);
	
	public User selectByOrgId(Integer orgId);
	
	public List<User> selectBranchByOrgId(Integer orgId);
	
	/**
	 * 查询身份证或者手机号存在的用户个数
	 * @param param
	 * @return
	 */
	public User selectByCondition(Map<String, Object> param);
	
	
	  /**
     * 查询一类机构注册 
     * @param param
     * @return
     */
     public List<User> selectByChannelCode(String channelCode);
     
     
     /*
      * 通过userId更新用户设置是否推送消息
      */
     public int updateIsMessagePush(@Param("id") Integer id,@Param("isMessagePush")  boolean isMessagePush);
     
     
     /**
      * 通过userId查询用户设置是否推送消息
      * @param id
      * @return
      */
     public boolean selectUserMessageInstall(@Param("id") Integer id);
     
     /**
      * 可查询已逻辑删除的
      * @param id
      * @return
      */
     public User queryById(Integer id);

	/**
	 * 根据设备ID查询客户信息
	 * 
	 * @param deviceId
	 * @return
	 */
	List<User> queryByDeviceId(String deviceId);

	RealNameAuthentication findRealNameCount(User user);
	
	int insertGuideInfo(User user);
	
	int updateGuideInfo(User user);

	
	User queryAllUserByMobileNo(String mobileNo);

	int updateDownloadApp(User user);

}
